Parameters and Meta-Functions
Adding parameters and bipp meta-functions increases the power and capabilities of your SQL. This example uses the $bipp_if meta-function to create an if-then-else construct in the SQL for the table enabling you to make the SQL conditional on parameter values. The $bipp_equal meta-function creates a Boolean condition in the SQL for a derived table.
Select the columns:
bipp generates the SQL:
SELECT t000.stock_code AS _0, t000.unit_price AS _1
FROM (
SELECT t000.invoice_num AS invoice_num,
t000.stock_code AS stock_code,
t000.unit_price AS unit_price
FROM (
SELECT t.invoice_num AS invoice_num,
t.stock_code AS stock_code,
t.unit_price AS unit_price,
t.country AS country
FROM `online_retail`.`stocks` AS s
JOIN `online_retail`.`transactions` AS t
ON s.code = t.stock_code
WHERE s.description like '%TAPE%'
) AS t000
GROUP BY 1, 2, 3
) AS t000
GROUP BY 1, 2
Fetch the data: